<h1>Listing clients</h1>

<% form_tag clients_path, :method => :get do %>
	<p>
		Chercher un client par son Nom<br />
		<%= text_field_tag :search, params[:search] %>
		<%= submit_tag "Search", :name => nil %>
	</p>
<% end %>

<table>
  <tr>
    <th>Nom</th>
    <th>Prenom</th>
  </tr>

<% for client in @clients %>
  <tr>
    <td><%=h client.nom %></td>
    <td><%=h client.prenom %></td>
    <td><%= link_to 'Select', client %></td>
    <td><%= link_to 'Edit', edit_client_path(client) %></td>
    <td><%= link_to 'Destroy', client, :confirm => 'Are you sure?', :method => :delete %></td>
  </tr>
<% end %>
<%= will_paginate(@clients) %>
</table>

<br />

<%= link_to 'New client', new_client_path %>

